package com.aotain.common;

import net.sf.json.JSONObject;

public class DBObject {
		/*
			name=sds
			type=javax.sql.DataSource
			maxActive=200
			maxIdle=50
			maxWait=10000
//			validationQuery=select sysdate from dual
			queryTimeout=60
			driverClassName=oracle.jdbc.driver.OracleDriver
			url=jdbc:oracle:thin:@192.168.5.25:1521:BSMP
			username=sds
			password=h16aug8v3w*/
	
	private String _name;
	private String _type;
	private String _maxActive;
	private String _maxIdle;
	private String _maxWait;
	private String _validationQuery;
	private String _queryTimeout;
	private String _driverClassName;
	private String _url;
	private String _username;
	private String _password;
	
	/*
	 * #SDS ORACLE
		dbdriver=oracle.jdbc.driver.OracleDriver
		dburl=jdbc:oracle:thin:@192.168.5.25:1521:BSMP
		dbuser=sds
		dbpassword=h16aug8v3w
	 */
	
//	private String dbdriver;
//	private String dburl;
//	private String dbuser;
//	private String dbpassword;
	
//	public String getDbdriver() {
//		return dbdriver;
//	}
//
//	public void setDbdriver(String dbdriver) {
//		this.dbdriver = dbdriver;
//	}
//
//	public String getDburl() {
//		return dburl;
//	}
//
//	public void setDburl(String dburl) {
//		this.dburl = dburl;
//	}
//
//	public String getDbuser() {
//		return dbuser;
//	}
//
//	public void setDbuser(String dbuser) {
//		this.dbuser = dbuser;
//	}
//
//	public String getDbpassword() {
//		return dbpassword;
//	}
//
//	public void setDbpassword(String dbpassword) {
//		this.dbpassword = dbpassword;
//	}

	public void setName(String name)
	{
		this._name = name;
	}
	
	public String getName()
	{
		return _name;
	}
	
	public void setType(String type)
	{
		this._type = type;
	}
	
	public String getType()
	{
		return this._type;
	}
	
	public void setMaxActive(String maxActive)
	{
		this._maxActive = maxActive;
	}
	
	public String getMaxActive()
	{
		return this._maxActive;
	}
	
	public void setMaxIdle(String maxIdle)
	{
		this._maxIdle = maxIdle;
	}
	
	public String getMaxIdle()
	{
		return this._maxIdle;
	}
	
	public void setMaxWait(String maxWait)
	{
		this._maxWait = maxWait; 
	}
	
	public String getMaxWait()
	{
		return this._maxWait;
	}
	
	public void setValidationQuery(String validationQuery)
	{
		this._validationQuery = validationQuery;
	}
	
	public String getValidationQuery()
	{
		return this._validationQuery;
	}
	
	public void setQueryTimeout(String queryTimeout)
	{
		this._queryTimeout = queryTimeout;
	}
	
	public String getQueryTimeout()
	{
		return this._queryTimeout;
	}
	
	public void setDriverClassName(String driverClassName)
	{
		this._driverClassName = driverClassName;
	}
	
	public String getDriverClassName()
	{
		return this._driverClassName;
	}
	
	public void setUrl(String url)
	{
		this._url = url;
	}
	
	public String getUrl()
	{
		return this._url;
	}
	
	public void setUserName(String username)
	{
		this._username = username;
	}
	
	public String getUserName()
	{
		return this._username;
	}
	
	public void setPassword(String password)
	{
		this._password = password;
	}
	
	public String getPassword()
	{
		return this._password;
	}

	
	public static DBObject getObject(String json)
	{
		JSONObject jsonObject = JSONObject.fromObject(json); 
		DBObject bean = (DBObject)JSONObject.toBean(jsonObject,DBObject.class);
		return bean;
	}
}
